From: Dmitry Shachnev Date: Wed, 28 Oct 2020 18:53:04 +0000 (+0000) Subject: guard UTIME_NOW/UTIME_OMIT usages X-Git-Tag: archive/raspbian/5.15.1+dfsg-2+rpi1^2~5 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ed7830a8f78ed5e7088f0a9604e2e7cbd4042e8a;p=qtbase-opensource-src.git guard UTIME_NOW/UTIME_OMIT usages Forwarded: no Last-Update: 2018-02-22 Gbp-Pq: Name nonlinux_utime.diff --- diff --git a/qmake/library/ioutils.cpp b/qmake/library/ioutils.cpp index d2171274d..6fada0005 100644 --- a/qmake/library/ioutils.cpp +++ b/qmake/library/ioutils.cpp @@ -228,7 +228,7 @@ bool IoUtils::touchFile(const QString &targetFileName, const QString &referenceF *errorString = fL1S("Cannot stat() reference file %1: %2.").arg(referenceFileName, fL1S(strerror(errno))); return false; } -# if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L +# if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L && defined(UTIME_NOW) const struct timespec times[2] = { { 0, UTIME_NOW }, st.st_mtim }; const bool utimeError = utimensat(AT_FDCWD, targetFileName.toLocal8Bit().constData(), times, 0) < 0; # else diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index 196081eaa..ef2ee1dd5 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -1595,7 +1595,7 @@ bool QFileSystemEngine::setFileTime(int fd, const QDateTime &newDate, QAbstractF return false; } -#if QT_CONFIG(futimens) +#if QT_CONFIG(futimens) && defined(UTIME_OMIT) struct timespec ts[2]; ts[0].tv_sec = ts[1].tv_sec = 0;